//
//  HMHomeNavView.m
//  HMMeituanHD
//
//  Created by apple on 2017/5/17.
//  Copyright © 2017年 itheima. All rights reserved.
//

#import "HMHomeNavView.h"

@interface HMHomeNavView ()

@property (weak, nonatomic) IBOutlet UIButton *imgBtn;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;


@end

@implementation HMHomeNavView

+ (instancetype)homeNavView{

    return [[NSBundle mainBundle] loadNibNamed:@"HMHomeNavView" owner:nil options:nil].lastObject;
}

- (IBAction)clickImgBtn:(id)sender {
    //生成action事件
    [self sendActionsForControlEvents:UIControlEventTouchUpInside];
}



#pragma mark - setter & getter 

- (void)setTitle:(NSString *)title{

    _title = title;
    self.titleLabel.text = _title;
}

- (void)setSubTitle:(NSString *)subTitle{

    _subTitle = subTitle;
    self.subTitleLabel.text = _subTitle;
}

- (void)setIconImgName:(NSString *)iconImgName{

    _iconImgName = iconImgName;
    
    [self.imgBtn setImage:[UIImage imageNamed:_iconImgName] forState:UIControlStateNormal];
}

- (void)setIconHighligtedImgName:(NSString *)iconHighligtedImgName{

    _iconHighligtedImgName = iconHighligtedImgName;
    [self.imgBtn setImage:[UIImage imageNamed:_iconHighligtedImgName] forState:UIControlStateHighlighted];
}

@end
